package com.esunrising.esungsc.controller;

import com.esunrising.esungsc.entity.TApiXmlb;
import com.esunrising.esungsc.service.CustomItemCategoryService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Api( value = "/internal/api/v1/customItemCategory", tags = "核算项目类别接口模块")
@RequestMapping("/internal/api/v1/customItemCategory")
@Slf4j
public class CustomItemCategoryController {

    @Resource
    private CustomItemCategoryService customItemCategoryService;

    @GetMapping("/customItemCategoryResult")
    public Object customItemCategoryResult(){

        String hszzid ="01050514";
        String year ="2023";

        //记录日志的参数
        String dwbh = "";
        String orgCode = "";

       List<TApiXmlb> tApiXmlbList =  customItemCategoryService.getCustomItemCategoryResult(hszzid,year,dwbh,orgCode);

       //向数据库中存储数据
       customItemCategoryService.saveTApiXmlb(tApiXmlbList);
       return tApiXmlbList;
    }
}
